package com.hll.controller;

import com.hll.pojo.User;
import com.hll.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author: Mr.Hu
 * @create: 2021-03-12 22:48
 */
@Controller
public class UserController {
  @Autowired private UserService userService;

  @ResponseBody
  @RequestMapping("/users")
  public List<User> list() {
    return userService.getAllUsers();
  }

  @RequestMapping("/success")
  public String toSuccess() {
    return "success";
  }
}
